<template>
	<section>
		<div class="xp_wrap">
			<el-button type="primary" @click="control_click('login')" plain>登录页面</el-button>
			<el-button type="primary" @click="control_click('profile')" plain>我的信息</el-button>
			<el-button type="primary" plain v-if="$i18n.locale=='en'"
				@click="control_switchLocale('zh')">切换成中文</el-button>
			<el-button type="primary" plain v-if="$i18n.locale=='zh'"
				@click="control_switchLocale('en')">切换成英文</el-button>
		</div>
		<xa-xclogin-login ref="xa-xclogin-login"></xa-xclogin-login>
		<xa-xclogin-profile ref="xa-xclogin-profile"></xa-xclogin-profile>
	</section>
</template>

<script>
	import config from "@/config/config.js";
	import xcHttpUtils from '@/library/xcore/js/XcHttpUtils.js';
	import xcViewUtils from '@/library/xcore/js/XcViewUtils.js';
	import {
		xsStringUtils,
		xsDateUtils,
		xsArrayUtils
	} from 'xstack-for-javascript';
	import xcLangUtils from '@/library/xcore/js/XcLangUtils.js';

	export default {
		data() {
			return {
				config: config,
				xsStringUtils: xsStringUtils,
				xsDateUtils: xsDateUtils,
				sp: {
					id: null
				},
				sr: {
					row: []
				},
				control: {}
			}
		},
		onLoad(options) {
			let that = this;
			that.sp.id = options.id;
			that.xinit();
		},
		onShow() {
			let that = this;
			that.$nextTick(function(res) {
				that.public_show();
			});
		},
		methods: {
			xinit() {
				let that = this;
			},
			public_reset() {
				let that = this;
				that.public_show();
			},
			public_show() {
				let that = this;

			},
			control_click(type) {
				let that = this;
				switch (type) {
					case "login":
						that.$refs['xa-xclogin-login'].public_show();
						break;
					case "profile":
						that.$refs['xa-xclogin-profile'].public_show();
						break;
				}
			},
			control_switchLocale(locale) {
				let that = this;
				xcLangUtils.switchLocale(locale);
			}
		}
	}
</script>

<style lang="scss">
	.xp_wrap {
		padding: $uni-spacing-col-lg;
	}
</style>